<?php
/**
 * Created by PhpStorm.
 * User: fangwei
 * Date: 2019-08-20
 * Time: 16:27
 */

namespace App\Http\Controllers\Admin\View;


use App\Http\Controllers\Controller;
use App\Http\Repositories\Services\ICategory;

class CategoryController extends Controller
{
    protected $categoryService;

    public function __construct(ICategory $categoryService)
    {
        $this->categoryService = $categoryService;
    }

    public function index(){
        return view('admin.category.index');
    }

    public function store(){
        return view('admin.category.create');
    }

    public function update($id){
        $dao = $this->categoryService->byId($id);
        return view('admin.category.edit',['dao'=>$dao]);
    }
}